<?php

/**
 * Created by PhpStorm.
 * User: zifeng
 * Date: 2017/7/13
 * Time: 23:58
 */
abstract class Animal
{
    protected $name = "";
    protected $shoutNum = 3;

    /**
     * Animal constructor.
     * @param string $name
     */
    public function __construct($name)
    {
        $this->name = $name;
    }

    function shout()
    {
        for ($i = 0;$i<$this->shoutNum ;$i++ ) {
            echo $this->name . "叫了一声" . $this->getShoutSound().PHP_EOL;
        }
    }
    abstract function getShoutSound();
}